all: main.cpp main

Sources		 = main.cpp
Objects		 = $(Sources:.cpp=.o)

.cpp.o:
	g++ -c -Wall $< -o $@
OS := $(shell uname)
main: main.o
ifeq ($(OS), Darwin)
	g++ $(Objects) -framework OpenGL -framework GLUT -o $@
else
	g++ $(Objects) -lGL -lGLU -lglut -o $@
endif

clean: 
	rm -f *.o
